using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using NetROS.Tiers.Data;
using NetROS.Tiers.Data.SqlClient;
using System.Collections.Specialized;
using System.Data.SqlClient;
using NetRosApp.Infrastructure.Interface.Constants;
using System.Security.Principal;

namespace NetRosApp.Infrastructure.Library.Services.Security
{
    public partial class UserSelectionForm : XtraForm
    {
        public bool integratedSecurity;
        public string serverName;
        public string username;
        public string password;
        public bool prompt = false;
        public string initialCatalog;
        public bool quit = false;

        public UserSelectionForm()
        {
            InitializeComponent();
          this.Focus();
             this.Activate();
        }

        private void UserSelectionForm_Load(object sender, EventArgs e)
        {
            tbUsername.Focus();
            cbIntegratedSecurity.Checked = integratedSecurity;
           tbServerName.Text = serverName;
            //tbUsername.Text = username;
            //tbPassword.Text = password;
            cbPrompt.Checked = prompt;
            tbApplicationName.Text = initialCatalog;
        }

        private void UserSelectionForm_FormClosed(object sender, FormClosedEventArgs e)
        {
            serverName = tbServerName.Text;
            username = tbUsername.Text;
            password = tbPassword.Text;
            prompt = cbPrompt.Checked;
            initialCatalog = tbApplicationName.Text;
            integratedSecurity = cbIntegratedSecurity.Checked;
        }

        private void button3_Click(object sender, EventArgs e)
        {
            quit = true;
            this.Close();
        }

        private void button4_Click(object sender, EventArgs e)
        {
            this.Close();
        }

    }
}